$(function(){
    //定义isDark变量
    var isDark =localStorage.getItem("isDark");
    //添加点击事件
    $(".classify .classy .dark").click(function(){
        localStorage.setItem("isDark","ture");
        setTheme();
    })
    $(".classify .classy .white").click(function(){
        localStorage.removeItem("isDark");
        setTheme2();
    });
    // 输出点击事件
    console.log("isDark");

    // 判断是否为真
    if(isDark == "ture"){
        setTheme();
    }
    // 添加样式
    function setTheme(){
        $(".container,.classify,.nav,.header").css({
            "background-color":"#000"
        });
        $(".status ul,.status ul li a h1,.content ul li").css({
            "background-color":"#5e5e5e",
            "color":"#fff"
        });
        $(".classify ul li,.classify ul li p").css({
            "background-color":"#5e5e5e",
            "border":"#000",
            "color":"#fff"
        });
        $(".nav").css({
            "background-color":"#5e5e5e",
            "color":"#fff"
        });
        $(".nav ul li span,.nav ul li p,.header h1,.header ul li p,.content ul li .status p,.content ul li h3,.content ul li .detail p,.content ul li .pay p:first-of-type,.personal h3,.choose ul li h3,.choose ul li .intro p,.bigmenu .menu p:first-of-type,.bigmenu .menu h3,.container .location h3,.dished ul li a p,.box .title  ").css({
            "color":"#fff"
        });
    }
    function setTheme2() {
      
        $(".container,.status ul,.classify ul li,.classify ul li p,.status ul li a h1,.header").css({
            "background-color":"#fff",
            "color":"#000"
        });
        $(".classify").css({
            "background-color":"#efefef"
        }); 
        $(".nav").css({
            "background-color":"#fff",
            "border":"#000",
            "color":"#fff"
        });
        $(".nav ul li span,.nav ul li p,.personal h3").css({
            "color":"#000"
        });
    }
})
